﻿{template 'header', 'member'}
<script type="text/javascript">c(2);</script>
<div class="menu">
<table cellpadding="0" cellspacing="0">
<tr>
<td class="tab" id="add"><a href="address.php?action=add"><span>Add Address</span></a></td>
<td class="tab_nav">&nbsp;</td>
<td class="tab" id="s3"><a href="address.php"><span>Delivery Address</span></a></td>
</tr>
</table>
</div>
{if $action=='add'}
<form method="post" action="address.php" id="dform" onsubmit="return check();">
<input type="hidden" name="action" value="{$action}"/>
<table cellpadding="6" cellspacing="1" class="tb">
<tr>
<td class="tl"><span class="f_red">*</span> Address</td>
<td class="tr">{ajax_area_select('post[areaid]', 'Please select')}<input name="post[address]" type="text" id="title" size="60" /> <span id="dtitle" class="f_red"></span></td>
</tr>

<tr>
<td class="tl"><span class="f_red">*</span> Zip code</td>
<td class="tr"><input name="post[postcode]" type="text" id="postcode" size="10" /> <span id="dpostcode" class="f_red"></span></td>
</tr>

<tr>
<td class="tl"><span class="f_red">*</span> Real Name</td>
<td class="tr"><input name="post[truename]" type="text" id="truename" size="10" /> <span id="dtruename" class="f_red"></span></td>
</tr>

<tr>
<td class="tl"><span class="f_red">*</span> Phone number</td>
<td class="tr"><input name="post[mobile]" type="text" id="mobile" size="20" /> <span id="dmobile" class="f_red"></span></td>
</tr>

<tr>
<td class="tl"> Phone number</td>
<td class="tr"><input name="post[telephone]" type="text" id="telephone" size="20" /> <span id="dtelephone" class="f_red"></span></td>
</tr>

<tr>
<td class="tl"> Display Order</td>
<td class="tr f_gray"><input name="post[listorder]" type="text" id="listorder" size="4" /> The lower the number the more forward<span id="dlistorder" class="f_red"></span></td>
</tr>

<tr>
<td class="tl"> Remarks</td>
<td class="tr"><input name="post[note]" type="text" id="note" size="60" /> <span id="dnote" class="f_red"></span></td>
</tr>

<tr>
<td class="tl">&nbsp;</td>
<td class="tr" height="50"><input type="submit" name="submit" value=" Determined " class="btn"/>&nbsp;&nbsp;&nbsp;&nbsp;<input type="reset" name="reset" value=" Reset " class="btn"/></td>
</tr>
</table>
</form>
{load('clear.js')}
<script type="text/javascript">s('address');m('add');</script>
{elseif $action=='edit'}
<form method="post" action="address.php" id="dform" onsubmit="return check();">
<input type="hidden" name="action" value="{$action}"/>
<input type="hidden" name="itemid" value="{$itemid}"/>
<input type="hidden" name="forward" value="{$forward}"/>
<table cellpadding="6" cellspacing="1" class="tb">

<tr>
<td class="tl"><span class="f_red">*</span> Address</td>
<td class="tr"><input name="post[address]" type="text" id="title" size="60" value="{$address}"/> <span id="dtitle" class="f_red"></span></td>
</tr>

<tr>
<td class="tl"><span class="f_red">*</span> Zip code</td>
<td class="tr"><input name="post[postcode]" type="text" id="postcode" size="10" value="{$postcode}" /> <span id="dpostcode" class="f_red"></span></td>
</tr>

<tr>
<td class="tl"><span class="f_red">*</span> Real Name</td>
<td class="tr"><input name="post[truename]" type="text" id="truename" size="10" value="{$truename}"/> <span id="dtruename" class="f_red"></span></td>
</tr>


<tr>
<td class="tl"><span class="f_red">*</span> Phone number</td>
<td class="tr"><input name="post[mobile]" type="text" id="mobile" size="20" value="{$mobile}"/> <span id="dmobile" class="f_red"></span></td>
</tr>

<tr>
<td class="tl"> Phone number</td>
<td class="tr"><input name="post[telephone]" type="text" id="telephone" size="20" value="{$telephone}"/> <span id="dtelephone" class="f_red"></span></td>
</tr>

<tr>
<td class="tl"> Display Order</td>
<td class="tr f_gray"><input name="post[listorder]" type="text" id="listorder" size="4" value="{$listorder}"/> The lower the number the more forward<span id="dlistorder" class="f_red"></span></td>
</tr>

<tr>
<td class="tl"> Remarks</td>
<td class="tr"><input name="post[note]" type="text" id="note" size="60" value="{$note}"/> <span id="dnote" class="f_red"></span></td>
</tr>
<tr>
<td class="tl">&nbsp;</td>
<td class="tr" height="50"><input type="submit" name="submit" value=" Modified " class="btn"/>&nbsp;&nbsp;&nbsp;&nbsp;<input type="button" value=" Back " class="btn" onclick="history.back(-1);"/></td>
</tr>
</table>
</form>
{load('clear.js')}
<script type="text/javascript">s('address');m('s3');</script>
{else}
<div class="ls">
<table cellpadding="0" cellspacing="0" class="tb">
<tr>
<th>Address (Zip)</th>
<th>Full name</th>
<th>Phone</th>
<th>Phone</th>
<th>添加时间</th>
<th>Sequence</th>
<th width="40">Modification</th>
<th width="40">Delete</th>
</tr>
{loop $lists $k $v}
<tr onmouseover="this.className='on';" onmouseout="this.className='';" align="center">
<td height="30" align="left">&nbsp;&nbsp{$v[address]}({$v[postcode]}){if $v[note]} <a href="javascript:" onclick="alert('Remark:{$v[note]}');"><img src="{DT_STATIC}{$MODULE[2][moduledir]}/image/why.gif" title="Remark:{$v[note]}"/></a>{/if}</td>
<td>{$v[truename]}</td>
<td>{$v[mobile]}</td>
<td>{if $v[telephone]}{$v[telephone]}{else}&nbsp;{/if}</td>
<td class="px11 f_gray" title="更新时间 {$v[editdate]}">{$v[adddate]}</td>
<td class="px11 f_gray">{$v[listorder]}</td>
<td><a href="address.php?action=edit&itemid={$v[itemid]}"><img width="16" height="16" src="{DT_STATIC}{$MODULE[2][moduledir]}/image/edit.png" title="Modification" alt=""/></a></td>
<td><a href="address.php?action=delete&itemid={$v[itemid]}" onclick="if(!confirm('Sure you want to delete this? This action shall be irrevocable')) return false;"><img width="16" height="16" src="{DT_STATIC}{$MODULE[2][moduledir]}/image/delete.png" title="Delete" alt=""/></a></td>
</tr>
{/loop}
</table>
</div>
{if $MG[address_limit]}
<div class="limit">Made a total of <span class="f_b f_red">{$MG[address_limit]}</span> Article&nbsp;&nbsp;&nbsp;Current issue <span class="f_b">{$limit_used}</span> strip&nbsp;&nbsp;&nbsp;You can also send <span class="f_b f_blue">{$limit_free}</span> strip</div>
{/if}
<div class="pages">{$pages}</div>
<script type="text/javascript">s('addr');m('s3');</script>
{/if}
{if $action=='add' || $action=='edit'}
<script type="text/javascript">
function check() {
	var l;
	var f;
	f = 'title';
	l = Dd(f).value.length;
	if(l < 5) {
		Dmsg('Please fill in the details Address', f);
		return false;
	}
	f = 'postcode';
	l = Dd(f).value.length;
	if(l < 6) {
		Dmsg('Please fill in ZIP', f);
		return false;
	}
	f = 'truename';
	l = Dd(f).value.length;
	if(l < 2) {
		Dmsg('Please fill out the real name', f);
		return false;
	}
	f = 'mobile';
	l = Dd(f).value.length;
	if(l < 11) {
		Dmsg('Please fill in mobile number', f);
		return false;
	}
	return true;
}
</script>
{/if}
{template 'footer', 'member'}